{{indexmenu_n>9}}

====== NMEA 0183 Sentences ======

**For a comprehensive explanation of the NMEA 0183 protocol** please read

[[http://www.catb.org/gpsd/NMEA.html|NMEA Revealed by Eric S. Raymond]]

Please note the 2008 Obsolete Nmea Sentences list in the Eric Raymond document.

  * [[http://www.hhhh.org/wiml/proj/nmeaxor.html|NMEA MTK Online Checksum Calculator]]
  * [[http://nmeachecksum.eqth.net/|NMEA Online Checksum Calculator]]
  * [[https://gist.github.com/maxp/1193206|Github NMEA Checksum code]]
  * [[https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:supplementary_software:nmea_instruments|NMEA in Supplementary Software]]
  *

Other References

  * [[http://www.gpsinformation.org/dale/nmea.htm|Explanation of NMEA sentences as used in GPS receivers]]
  * [[https://www.nmea.org/Assets/20190219%200183%20manufacturer%20codes.pdf|Prefix Sentence Characters for Sources -NMEA0183 Manufacturer's Mnemonic Codes]]
  * [[https://www.nmea.org/Assets/100108_nmea_0183_sentences_not_recommended_for_new_designs.pdf|NMEA 0183 Sentences Not Recommended for New Designs, Approved by the NMEA 0183 Standard Committee as of October 1, 2008]]
  * [[https://www.nmea.org/Assets/20190303%20nmea%200183%20talker%20identifier%20mnemonics.pdf|NMEA 0183 Talker Identifier Mnemonics - 2019]]

==== OpenCPN does not use or recognize NMEA 2000 ====

===== OpenCPN Core Program: =====

Normal prefix: "$" however AIS messages use the prefix: "!"

==== Recognized NMEA0183 Sentences ====

=== HDM - Heading, Magnetic ===

  - Heading Degrees, magnetic
  - M = magnetic

=== HDG - Magnetic heading, deviation, variation ===

  - Magnetic Sensor heading in degrees
  - Magnetic Deviation, degrees
  - Magnetic Deviation direction, E = Easterly, W = Westerly
  - Magnetic Variation degrees
  - Magnetic Variation direction, E = Easterly, W = Westerly

If HDG message also contains the variation and E/W flags then O will use that. If not then it will look in RMC message for a variation. If nothing there it will use WMM plugin unless user has selected the variation manually in options.

=== HDT - Heading, True ===

  - Heading Degrees, true
  - T = True

=== RMB - Recommended Minimum Navigation Information ===

To be sent by a navigation receiver when a destination waypoint is active.
<code>

''
                                                            14
        1 2   3 4    5    6       7 8        9 10  11  12  13|  15
        |   |   |   |    |   |       |   |        |   |   |   |   |   |   |
 $--RMB,A,x.x,a,c--c,c--c,llll.ll,a,yyyyy.yy,a,x.x,x.x,x.x,A,m,*hh<CR><LF>''

</code>

Field Number:

  - Status, A= Active, V = Void
  - Cross Track error - nautical miles
  - Direction to Steer, Left or Right
  - FROM Waypoint ID
  - TO Waypoint ID
  - Destination Waypoint Latitude
  - N or S
  - Destination Waypoint Longitude
  - E or W
  - Range to destination in nautical miles
  - Bearing to destination in degrees True
  - Destination closing velocity in knots
  - Arrival Status, A = Arrival Circle Entered
  - Status A - Data Valid, V - Data Invalid, FAA mode indicator (NMEA 2.3 and later)

RMB in a navigation sentence that combines GPS information with the coordinates of the Waypoint. The data it contains are the result of these calculations on the line that joins the position of the ship and the Waypoint. VMG is the right thing to do. VMG = SOG * cos (COG - BRG). It does not make sense to put the SOG in its place.

=== RMC -Recommended Minimum Navigation Information ===

  - Time (UTC)
  - Status, V = Navigation receiver warning
  - Latitude
  - N or S
  - Longitude
  - E or W
  - Speed over ground, knots
  - Track Made Good, degrees true
  - Date, ddmmyy
  - Magnetic variation, degrees
  - E or W
  - Status A - Data Valid, V - Data Invalid, FAA mode indicator (NMEA 2.3 and later)

RMC in a sentence created only by the GPS (Or position system) based on the data received only by the receiver. There is no waypoint or route information. COG and SOG should appear here.

=== xxWPL - Waypoint Location ===

Used to send routes and waypoints up to a GPS receiver. OpenCPN converts incoming WPL messages to AIS-APRS position reports if the option "Treat WPL sentences as APRS position reports" under AIS settings is enabled.

  - Latitude
  - N or S (North or South)
  - Longitude
  - E or W (East or West)
  - Waypoint Name

=== xxRTE - Routes ===

Used to send routes and waypoints up to a GPS receiver.OpenCPN does not process these sentences as input.

  - Total number of messages being transmitted
  - Message Number
  - Message Mode
      - c = complete route, all waypoints
      - w = working route, the waypoint you just left, the waypoint you're heading to, then all the rest
  - Waypoint ID
  - More Waypoints

=== GGA - Global Positioning System Fix Data ===

  - Universal Time Coordinated (UTC)
  - Latitude
  - Longitude
  - GPS Quality Indicator
  - Number of satellites in view, 00 - 12
  - Horizontal Dilution of Precision (HDOP)
  - Antenna altitude above/below mean-sea-level (geoid)
  - Units of antenna altitude, meters
  - Geoidal separation, the vertical difference between the WGS-84 elipsoid and the geoid
  - Units of geoidal separation, meters
  - Age of differential GPS data, time in seconds since last SC104
  - Differential reference station ID, 0000-102

GGA data is used to indicate the quality and number of satellites to fix the position. The boat becomes red and the 3 green bars when at maximum.

=== GLL - Geographic Position, Latitude / Longitude ===

  - Latitude
  - N or S (North or South)
  - Longitude
  - E or W (East or West)
  - Time (UTC)
  - Status A - Data Valid, V - Data Invalid, FAA mode indicator (NMEA 2.3 and later)

=== GSV - Satellites in view ===

  - Number of sentences for full data / sentence 1 of 2
  - Number of satellites in view
  - Satellite PRN number
  - Elevation, degrees
  - Azimuth, degrees
  - SNR - higher is better / for up to 4 satellites per sentence

=== VTG - Track Made Good and Ground Speed ===

  - Track Degrees
  - T = True
  - Track Degrees
  - M = Magnetic
  - Speed Knots
  - N = Knots
  - Speed Kilometers Per Hour
  - K = Kilometers Per Hour
  - Status A - Data Valid, V - Data Invalid, FAA mode indicator (NMEA 2.3 and later)

=== GPwpl - Waypoint Data ===

Only when there is an active route (this is sometimes bidirectional).

=== APB - Autopilot Sentence "B" ===

This is a fixed form of the APA sentence with some ambiguities removed.

Note: Some autopilots, Robertson in particular, misinterpret "bearing from origin to destination" as "bearing from present position to destination". This is likely due to the difference between the APB sentence and the APA sentence. for the APA sentence this would be the correct thing to do for the data in the same field. APA only differs from APB in this one field and APA leaves off the last two fields where this distinction is clearly spelled out. This will result in poor performance if the boat is sufficiently off-course that the two bearings are different.

Field Number:

  - Status V = LORAN-C Blink or SNR warning V = general warning flag or other navigation systems when a reliable fix is not available
  - Status V = Loran-C Cycle Lock warning flag A = OK or not used
  - Cross Track Error Magnitude
  - Direction to steer, L or R
  - Cross Track Units, N = Nautical Miles
  - Status A = Arrival Circle Entered
  - Status A = Perpendicular passed at waypoint
  - Bearing origin to destination
  - M = Magnetic, T = True
  - Destination Waypoint ID
  - Bearing, present position to Destination
  - M = Magnetic, T = True
  - Heading to steer to destination waypoint
  - M = Magnetic, T = True

=== XTE - Measured cross track error ===

Measured cross track error is a part of the RMB message, for compatibility with some older equipment designed to work with Loran.

  - Cross track error, measured
  - General warning flag V = warning
  - (Loran-C Blink or SNR warning)
  - Not used for GPS (Loran-C cycle lock flag)
  - Cross track error distance
  - L - Steer left to correct error (or R for right)
  - N- Distance units - Nautical miles
  - Status A - Data Valid, V - Data Invalid, FAA mode indicator (NMEA 2.3 and later)

=== AIVDM - Automatic Information System (AIS) ===

Sent by AIS handled by the AIS Decoder as an AIS target

Position and static data reports from other vessels. The body of this message is an encoded ASCII string that needs special logic to decode. it contains the following information about other ships.

  - Time (UTC)
  - MMSI Number
  - Latitude
  - Longitude
  - Speed Knots
  - Heading
  - Course over Ground
  - Rate of turn
  - Ship Type
  - Ship Name
  - Ship Callsign
  - Ship length, beam and draft
  - Navigation status

=== AIVDO - Automatic Information System (AIS) ===

Sent by AIS handled by the AIS Decoder as an AIS target (option)

Position reports from own vessel

  - Latitude
  - Longitude
  - Speed over ground
  - Course over ground
  - MMSI, navigational status, ship type, call sign, destination, sizes (in AIS target list)

=== xxTTM ===

Sent by the Radar (ARPA / MARPA) and handled by the AIS Decoder in the same way as an AIS target

Tracked Target Message

  - Target Number (0-99)
  - Target Distance
  - Bearing from own ship
  - Bearing Units
  - Target Speed
  - Target Course
  - Course Units
  - Distance of closest-point-of-approach
  - Time until closest-point-of-approach "-" means increasing
  - "-" means increasing
  - Target name
  - Target Status
  - Reference Target

=== xxTLL ===

Sent by the Radar and plugin radar_pi (ARPA / MARPA) and handled by the AIS Decoder in the same way as an AIS target

Target Latitude and Longitude

  - Target Number (not used/ignored)
  - Latitude
  - Longitude
  - Name
  - Status
  - Reference Target (not used/ignored)

=== xxOSD ===

Own Ship Data

  - Heading, degrees true
  - Status, A = Data Valid
  - Vessel Course, degrees True
  - Course Reference
  - Vessel Speed
  - Speed Reference
  - Vessel Set, degrees True
  - Vessel drift (speed)
  - Speed Units

=== FPROS ===

GPSGate Buddy Position Update.

  - Latitude
  - Hemisphere N/S
  - Longitude
  - Hemisphere E/W
  - Altitude in meters above sea level
  - Speed over ground in knots
  - Heading over ground in degrees
  - Date
  - Time UTC
  - Name of buddy this position info belongs to.

  * Notes: CDDSC and CDSE. These standards are not fully supported by Opencpn.
  * CDDSC - Digital Selective Calling Information (DSC)
  * CDDSE - Extended Digital Selective Calling Information, including a more accurate position. (DSE)
      * [[http://continuouswave.com/whaler/reference/DSC_Datagrams.html|Data Interface in Digital Selective Calling Class-D Radios]]
      * [[http://www.cruisersforum.com/forums/f13/nmea-0183-sentences-dsc-dse-124887.html#post2325905|Cruiser Forum Thread]]
      * Example Sentences:
<code>

1      2  3          4  5  6  7          8    9  10 11 12 13
|   |  |   |  |   |  |   |    |   |  |   |  |
$CDDSC,12,3380400790,12,06,00,1423108312,2019, ,  , S, E  *6A

</code>

  - $CDDSC–from a DSC radio.
  - 12–distress alert call.
  - 3381581370–the MMSI of the sender.
  - 12–category is "distress."
  - 06–Nature of Distress is"adrift."
  - 00–preferred follow-on communication by frequency- or phase-modulated simplex radio telephony.
  - 1423108312–position, which 42-degrees 31-minutes latitude, 083-degrees 12-minutes longitude, in North and West.
  - 0236–message was sent at 0236-UTC.
  - 3381581370–now the new information! This is a repeat of the MMSI of the sender. Since I know this datagram comes from receiving a distress alert cancelation message, the repetition of the same MMSI in this field as in the sender's field must be significant. In ITU-Rec. M.493-13, in Table 4.2 there is a footnote, which says, "Distress acknowledgments where the transmitting MMSI and ship in distress MMSI are the same, the message should be interpreted as a self Cancel operation." This sheds light on the nature of this field. This field must be "the address of vessel in distress" if the message is a distress acknowledgement message.
  - [null]–still no signal in this field.
  - S–end of sequence.
  - [null]–no expansion message to follow since no "E" here.
      * 20–checksum.
<code>

1      2  3  4  5          6  7       8
|   |  |   |  |   |  |   |
$CDDSE,1, 1, A, 3380400790,00,45894494*1B

</code>

  - $CDDSE–from a DSC radio. Since this followed a datagram that indicated an expansion message would follow, this datagram is a representation on the wired data link of that DSC expansion message.
  - 1–based on similar coding seen in other datagrams, this field is likely to indicate the total number of datagrams that are part of this expansion message.
  - 1–as suggested above, this is likely the number of this datagram in the message sequence. Since this is one of a total of one, this datagram contains all the data for the expansion message.
  - A–to be determined.
  - 3380400790–a ten-digit representation of the sender's MMSI.
  - 00–this field of two-digits appears to be the expansion data specifier described in Table 1 of ITU-Rec.M821-1, but with the symbol representation in two-digits instead of three-digits. The leading "1" seems to not be used. (See modified table, above.) This field identifies the data that will follow in the next field. In this message, the data will be "enhanced position resolution."
  - 45894494–the data payload, which is eight digits. The first four are the decimal portion of the latitude minutes; the last four are the decimal portion of the longitude minutes. The latitude and longitude whole minutes were sent in the immediately preceding datagram. This is as specified in the ITU-Rec. M.821-1 in section 2.1.2.1
  - *1B–checksum.

  * For more detail refer to [[http://continuouswave.com/whaler/reference/DSC_Datagrams.html|Data Interface in Digital Selective Calling Class-D Radios]]
  * For more details on how OpenCPN interprets all recognized sentences, look at the **"AIS_DecoderA.cpp"**  file in the source code. For the Dashboard plugin, look at the different files in the "nmea0183" directory.

=== Not Used ===

  * BOD - Bearing - Origin to Destination
      * Bearing angle of the line, calculated at the origin waypoint, extending to the destination waypoint from the origin waypoint for the active navigation leg of the journey.
      * This sentence should coincide with field 11 of RMB.
      * It is logical that OCPN does not use it, since it is irrelevant if it already sends RMB, which is more common and recommended.

===== Dashboard Plugin =====

=== Dashboard Plugin recognized NMEA 0183 sentences ===

  * **DBT**  - Depth Below Transducer
  * **DPT**  - Depth of Water
  * **GGA**  - Global Positioning System Fix Data
  * **GLL**  - Geographic Position - Latitude/Longitude HDG Heading - Deviation & Variation
  * **GSV**  - Satellites in view
  * **HDM**  - Heading - Magnetic
  * **HDT**  - Heading - True
  * **MTA**  - Air Temperature (obsolete)
  * **MDA**  - Meteorological Composite (obsolete) -see below
  * **MTW**  - Mean Temperature of Water
  * **VLW**  - Distance Traveled through Water
  * **MWD**  - Wind Direction & Speed
  * **MWV**  - Wind Speed and Angle
  * **RMC**  - Recommended Minimum Navigation Information
  * **RSA**  - Rudder Sensor Angle
  * **VHW**  - Water speed and heading
  * **VTG**  - Track made good and Ground speed
  * **VWR**  - Relative Wind Speed and Angle
  * **VWT**  - True Windspeed and Angle (obsolete)
  * **XDR**  - Transducer Values - see below
  * **ZDA**  - Time & Date - UTC, day, month, year and local time zone
=== MDA ===

Meteorological Composite (obsolete) This message is obsolete and NMEA recommends to use XDR transducer messages instead.  However, old instruments might still sending this message.  OpenCPN reads the second value "Barometric pressure, bars", but only if the number provided is between 0.8 and 1.1  All other values are ignored.
<code>

''
$--MDA,x.x,I,**x.x,B**,x.x,C,x.x,C,x.x,x.x,x.x,C,x.x,T,x.x,M,x.x,N,x.x,M*hh<CR><LF> \\
|   |        |   |    |   |    |   |    |   |    | \\
|   |        |   |    |   |    |   |    |   |    Wind speed, meters/second \\
|   |        |   |    |   |    |   |    |        Wind speed, knots \\
|   |        |   |    |   |    |   |    Wind direction, degrees Magnetic     \\
|   |        |   |    |   |    |        Wind direction, degrees True \\
|   |        |   |    |   |    Dew point, degrees C \\
|   |        |   |    |    Absolute humidity, percent \\
|   |        |   |    Relative humidity, percent \\
|   |        |        Water temperature, degrees C \\
|   |        Air temperature, degrees C \\
|      **//Barometric pressure, bars// ** \\
Barometric pressure, inches of mercury''

</code>

=== XDR ===

Transducer Values
<code>

            1 2   3 4       n
|   |   |   |       | \\
*  $--XDR,a,x.x,a,c--c, ..... *hh<CR><LF> \\

</code>

  * Field Number:
  * 1) Transducer Type
  * 2) Measurement Data
  * 3) Units of measurement
  * 4) Name of transducer
  * x) More of the same
  * n) Checksum

  * Example:
  * $IIXDR,C,19.52,C,TempAir*19
  * $IIXDR,P,1.02481,B,Barometer*29

  * Currently, OpenCPN recognizes the following transducers:
<code>

Measured Value | Transducer Type | Measured Data   | Unit of measure | Transducer Name
------------------------------------------------------------------------------------------------------
barometric     | "P" pressure    | 0.8..1.1 or 800..1100           | "B" bar         | "Barometer"
air temperature| "C" temperature |   2 decimals                    | "C" celsius     | "TempAir" or "ENV_OUTAIR_T"
pitch          | "A" angle       |-180..0 nose down 0..180 nose up | "D" degrees     | "PTCH" or "PITCH"
rolling        | "A" angle       |-180..0 L         0..180 R       | "D" degrees     | "ROLL"
water temp     | "C" temperature |   2 decimals                    | "C" celsius     | "ENV_WATER_T"
-----------------------------------------------------------------------------------------------------

</code>

=== ZDA ===

Time & Date - UTC, day, month, year and local time zone This is one of the sentences commonly emitted by GPS units.
<code>

        1         2  3  4    5  6  7
        |   |  |   |    |   |  |
 $--ZDA,hhmmss.ss,xx,xx,xxxx,xx,xx*hh<CR><LF>

</code>

Field Number:

  - UTC time (hours, minutes, seconds, may have fractional subsecond)
  - Day, 01 to 31
  - Month, 01 to 12
  - Year (4 digits)
  - Local zone description, 00 to + - 13 hours (- means East longitude)
  - Local zone minutes description, 00 to +-59 (- means East longitude)
  - Example: $GPZDA,160012.71,11,03,2004,-1,00*7D

==== NMEA version 2.3 ====

Added a mode indicator to many sentences to indicate what kind of fix the receiver has. The value can be one of

  * A=autonomous
  * D=differential
  * E=Estimated
  * N=not valid,
  * S=Simulator.

Sometimes there can even be a null value as well. \\ The A and D are the only vales that will indicate an Active and reliable Sentence. \\ This mode character has been added to the end of RMC, RMB, VTG, and GLL sentences. \\ Optionally, to some others as well, including the BWC and XTE sentences.

===== Notes: =====

  - For more details on how OpenCPN interprets all recognized sentences, look at the “AIS_DecoderA.cpp” file in the source code. For the Dashboard plugin, look at the different files in the “nmea0183” directory.

